﻿using System.Text;
using gmeow.Framework;
using Growl.Framework;

namespace meow.displays.Growl
{
    public class GrowlDisplay : IDisplay
    {
        private Growler growler;
        private static NotificationType newMail = new NotificationType("New Email", true);

        public GrowlDisplay()
        {

            growler = new Growler("gmeow!"); 
            var types = new NotificationType[] { newMail };
            growler.Register(ref types);
        }
        public void Accept(string sender, string[] titles, string[] descriptions)
        {
            StringBuilder sb = new StringBuilder();

            foreach (string title in titles)
            {
                sb.AppendLine(title);
            }

            growler.Notify(newMail, string.Format("{0} ({1})", sender, titles.Length), sb.ToString(), Priority.Normal, false);

        }
    }
}